﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:csla="clr-namespace:Csla.Wpf;assembly=Csla"
    xmlns:library="clr-namespace:Kiosk.Library;assembly=Kiosk.Library"
    xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase"
    x:Class="Kiosk.UserControls.NotificationListPresenter"                   
    Height="Auto" Width="Auto" Margin="0,10,0,0"  DataContextChanged="uc_dataContextChanged"
>
    <UserControl.Background>
        <ImageBrush ImageSource="images\notepad.png" Stretch="Fill" />
    </UserControl.Background>
    <StackPanel Name="pnlList" Margin="10,0,10,0" HorizontalAlignment="Stretch">
        <Border Name="brdrHeader"  Height="35" >
            <TextBlock  Name="txtHeading" HorizontalAlignment="Center" FontFamily="Comic Sans MS" VerticalAlignment="Center" Text="Header" FontSize="30" />
        </Border>
        <Border >
             <ListBox MaxHeight="245" DataContextChanged="lstNotifications_DataContextChanged" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Name="lstNotifications" Margin="5"  BorderBrush="Transparent" Background="Transparent" ItemsSource="{Binding}" MouseUp="lstNotifications_SelectionChanged" SizeChanged="lstNotifications_SizeChanged" >
                    <ListBox.ItemTemplate>
                    <DataTemplate DataType="{x:Type library:NotificationInfo}">
                        <Grid  Width="{Binding ElementName=lstNotifications,Path=ActualWidth}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="1*" />
                                <ColumnDefinition Width="2*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <Image Height="45" Grid.RowSpan="2" Grid.Column="0" Source="{Binding Path=IconFile}" Stretch="Uniform" />
                            <TextBlock Grid.Column="1" Grid.Row="0" Background="Transparent" FontFamily="Comic Sans MS" Text="{Binding Path=Title}" FontSize="16" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
                            <TextBlock Grid.Column="1" Grid.Row="1" Background="Transparent" FontFamily="Comic Sans MS" Text="{Binding Path=LocationName}" HorizontalAlignment="Left" VerticalAlignment="Top" />
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Border>
    </StackPanel>
</UserControl>
